import request from '@/utils/sysRequest';
import axios from 'axios';
/**
 * 查询所有预案
 * @param {*} reqId
 */

export function getAllPlan() {
	return request({
		url: '/api/digitalEarth/plotPlan/all',
		method: 'get',
	});
}
/**
 * 根据ID查询预案
 * @param {*} reqId
 */

export function getOnePlan(id) {
	return request({
		url: `/api/digitalEarth/plotPlan/${id}`,
		method: 'get',
	});
}

/**
 * 查询是否重命名
 * @param {*} name   没有ID不传
 */

export function extPlan(deviceName) {
	return request({
		url: '/api/digitalEarth/plotPlan/extPlotPlan',
		method: 'get',
		params: {
			deviceName: deviceName,
		},
	});
}
/**
 * 更新或添加预案
 * @param {*} reqId
 *
 */

export function updatePlan(param) {
	return request({
		url: '/api/digitalEarth/plotPlan/add',
		method: 'post',
		data: param,
		headers: {
			'Content-Type': 'application/json;charset=UTF-8',
		},
	});
}
